
(function($){
    $.fn.attachHint = function(hintText) {
        return this.each(function() {
            var input = $(this);
            function clearHint(){
                if(input.val()==hintText || input.val()=='Enter your email to sign up')
                    input.val("");
            }

            function setHint(){
                if(input.val().length==0 || input.val()==hintText || input.val()=='Enter your email to sign up'){
                    if ($(window).width() < 959) {
						input.val('Enter your email to sign up');
					}
					else {
						input.val(hintText);	
					}
                }
            }
			
            input.focus(clearHint);
            input.blur(setHint);
            input.change(setHint);

            setHint();
        });
    };
})(jQuery);  